﻿<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/common/taglibs.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>机构-人员修改</title>
    <!--common-->
    <link rel="stylesheet" href="/resources/src/css/lib/bootstrap.min.css"/>
	<link rel="stylesheet" href="/resources/src/css/admin/main.css" />
</head>
<body>
    <article class="main">
			<div class="main-wrapper">
				<section class="content">
					<div class="container">
						<div class="con-body">
							<div class="input-row">
								<input type="hidden" id="userId" value="${user.id }"/>
								<label for="#name"><span>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</span></label>
								<input type="text" id="name" name="name" placeholder="请输入姓名" value="${user.userName }" readonly="readonly"/>
							</div>
							<div class="input-row">
								<label for="#phone"><span>手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：</span></label>
								<input type="text" id="phone" name="phone" placeholder="请输入手机号" value="${user.phone }"/>
							</div>
							<div class="input-row">
								<label for="#email"><span>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱：</span></label>
								<input type="text" id="email" name="email" placeholder="请输入邮箱" value="${user.email }"/>
							</div>
							<div class="submit text-center">
								<p class="btn-text">
									<span id="updateUser">确认</span>
								</p>
							</div>
						</div>
					</div>
				</section>
			</div>
		</article>
    
    <script src="/resources/src/js/jquery-1.9.1.min.js"></script>
    <script src="/resources/src/js/jquery.nicescroll.js"></script>  
    <script src="/resources/src/js/jquery.validate.min.js"></script>
    <script src="/resources/src/js/messages_zh.js"></script>  
    <script src="/resources/src/js/main.js"></script>
    <script>
    	
    	$(function(){
    		$("#updateUser").on("click",function(){
    			var phone=$("#phone").val();
    			var email=$("#email").val();
    			var userId=$("#userId").val();
	     		$.ajax({
	    			type:"post",
	    			url:"/admin/user/edit",
	    			async:true,
	    			dataType:'json',
	    			data:{"id":userId,"phone":phone,"email":email},
	    			success:function(data){
	    				alert(data.data);
	    				location.reload(); 
	    				//window.location.href="/admin/user/list";
	    			}
	    		});
    	 	})
    	})
    </script>
    
</body>
</html>